/// @tags:
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <numeric>

using std::cin, std::cout, std::endl;

namespace BlueQuantum {

constexpr int maxn = 100;

char str[maxn];

void solve() {
  cin >> (str);
  int len = strlen(str);
  for (int j = 1; j < len / 2; ++j) {
    if (str[j] != str[0]) {
      cout << "YES" << endl;
      return;
    }
  }
  cout << "NO" << endl;
}

int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    solve();
  }
  return 0;
}

}  // namespace BlueQuantum

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("A. New Palindrome.in", "r", stdin);
  freopen("A. New Palindrome.out", "w", stdout);
#endif
#endif

  std::ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  return BlueQuantum::main();
}
